#include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;

#define rep(i,n) for (int i=0; i<n; i++)

#define TRACE(x...) 
#define PRINT(x...) TRACE(printf(x))

#define MULT_TEST(x...)  

int _42;
char num[15];
char bob[15];
int l;
char small;
int ind;

int main() {
	MULT_TEST(
		scanf("%d", &_42);

		while (_42--) {
	)

	scanf(" %s", num);
	scanf(" %s", bob);	

	PRINT("%s %s\n", num, bob);

	l = strlen(num);

	small='9'+1;	

	rep(i,l) {
		if (small>=num[i] && num[i]!='0') {
			small=num[i];
			ind=i;
		}
	}
	if (small<'9'+1) {
		num[ind]=num[0];
		num[0]=small;
	}

	sort(&num[1], num+l);

	PRINT("%s %s\n", num, bob);

	if (!strcmp(num, bob))
		printf("OK\n");
	else
		printf("WRONG_ANSWER\n");		

	MULT_TEST( } )
	
	return 0;
}
